﻿// for ehr
//author:linsendu-dyb
//date:20110616
(function(){
    EHR={};
    var ver=window.navigator.userAgent.substr(window.navigator.userAgent.indexOf("MSIE")+5,2);
    EHR.version=parseInt(ver)>0?parseInt(ver):0;
    if(window.EHRLayer)
    {
        alert("the object window.EHRLayer has been already used,it will be replace window._EHRLayer");
        window._EHRLayer=window.EHRLayer;
    }

    window.EHRLayer=function(param){    
        param=typeof param=='object'?param:{};
        this.tbl=window.config.data;
        this.colNum= typeof window.config.colNum == 'number' ? window.config.colNum : 4;//列数
        this.limitNum=typeof window.config.limitNum == 'number' ? window.config.colNum : 1;//最多能选择项数
        this.isMulti=window.config.isMulti||true;//是否要多选
        this.maxSelectNum = typeof window.config.maxSelectNum == 'number' ? window.config.maxSelectNum : 3;//仅当this.isMulty为true时有效                
        //end EHRLayer 
    }
    
    var layer=window.EHRLayer.prototype;    
    
    layer.showDiv=function(followObj,isBigMask){//参数:跟随对象,是否为全屏遮罩
        this.div=EHR.$('EHRDivBox'+(window.config.uniqueId||''));
        if(!this.div){
            this.div=document.createElement('div');        
            this.div.id='EHRDivBox'+(window.config.uniqueId||'');
            document.body.appendChild(this.div);
        }
        this.div.className=window.config.divClass;
		EHR.setContent(this.div,this.tbl);//为层设置内容		
		this.div.style.visibility='visible';    
        this.div.style.display='block';
		var thisObj=this;
        this.div.onmouseover = function(event) {this.canClose=false;EHR.highlight(event,this);};
	    this.div.onmouseout = function(event) {this.canClose=true; EHR.recoverBg(event,this);};
        if(typeof followObj=='object'&&EHR.$(followObj.id)){
            EHR.setToObj(followObj,this.div);
            EHR.$(followObj.id).onmouseover = function(event) {thisObj.div.canClose=false;EHR.highlight(event,thisObj.div);};
            EHR.$(followObj.id).onmouseout = function(event) {thisObj.div.canClose=true;EHR.recoverBg(event,thisObj.div);};
        }else{
            EHR.setBoxPosition(this.div);//显示完成后才能定位
        }
        var maskObj=EHR.openDivMask(isBigMask,this.div);        
        if(maskObj)maskObj.style.display='block';//show mask div
        if(!isBigMask){
            EHR.maskSynDiv(maskObj,this.div);            
        }
    }

    layer.showDivNew=function(followObj,isBigMask,fullName){//参数:跟随对象,是否为全屏遮罩
        this.div=EHR.$('EHRDivBox'+(window.config.uniqueId||''));
        if(!this.div){
            this.div=document.createElement('div');        
            this.div.id='EHRDivBox'+(window.config.uniqueId||'');
            document.body.appendChild(this.div);
        }
        this.div.className=window.config.divClass;
        var title=this.createTitle();
		var titleBottom=this.createTitleBottom(fullName);
        EHR.setContentNew(this.div,this.tbl,title,titleBottom);//为层设置内容		
		this.div.style.visibility='visible';    
        this.div.style.display='block';
		var thisObj=this;
        this.div.onmouseover = function(event) {this.canClose=false;EHR.highlight(event,this);};
	    this.div.onmouseout = function(event) {this.canClose=true; EHR.recoverBg(event,this);};
        if(typeof followObj=='object'&&EHR.$(followObj.id)){
            EHR.setToObj(followObj,this.div);
            EHR.$(followObj.id).onmouseover = function(event) {thisObj.div.canClose=false;EHR.highlight(event,thisObj.div);};
            EHR.$(followObj.id).onmouseout = function(event) {thisObj.div.canClose=true;EHR.recoverBg(event,thisObj.div);};
        }else{
            EHR.setBoxPosition(this.div);//显示完成后才能定位
        }
        var maskObj=EHR.openDivMask(isBigMask,this.div);        
        if(maskObj)maskObj.style.display='block';//show mask div
        EHR.OpenDivMask();
        if(!isBigMask){
            EHR.maskSynDiv(maskObj,this.div);            
        }
    }
    
    layer.createSelectTr=function(data){
        if(data){
            var tr=this.tbl.insertRow(-1);
            if(data['trClassName']){//设置样式
                tr.className=data['trClassName'];
            }
            var _values,isHasLeft;
            if(data['subIds']){
                var subTd=document.createElement('td');
                subTd.rowSpan=Math.ceil(data['subIds'].length/(this.colNum-1));
                subTd.innerHTML=data['parentName'].replace("&","&amp;");;
                if(data['parentClassName']){
                    subTd.className=data['parentClassName'];
                }
                tr.appendChild(subTd);
                _values=data['subIds'];
                isHasLeft=true;
            }
            else{
                _values=data;
                isHasLeft=false;
            }
            for(var i=0;i<_values.length;i++){
                if ( ( !isHasLeft && 0 == i % this.colNum ) || ( isHasLeft && i != 0 && 0 == i % ( this.colNum - 1 ) ) ) {
                    tr=this.tbl.insertRow(-1);
                    if(data['trClassName']){//设置样式
                        tr.className=data['trClassName'];
                    }
                }
                tr.appendChild(this.organizeTd(_values[i]));
            }
            var colNum = isHasLeft ? this.colNum - 1 : this.colNum;
			var modNum = i % colNum;
			if ( modNum > 0 ) {
				var td = document.createElement('td');
				td.colSpan = colNum - modNum;
				tr.appendChild( td );
			}
        }
    }

    layer.createSelectTrNew=function(data){
        if(data){
            var tr=this.tbl.insertRow(-1);
            var _values;
            if(data['subIds']){
                var subTh=document.createElement('th');
                subTh.setAttribute('valign','top');
                var p =document.createElement('p');
                p.innerHTML=data['parentName'].replace("&","&amp;");
                subTh.appendChild(p);
                tr.appendChild(subTh);
                _values=data['subIds'];
            }
            else{
                _values=data;
            }
            for (var i = 0; i < this.colNum-1; i++) {
                subTd=document.createElement('td');
                for (var j = 0; j < _values.length; j++) {
                    if ((j-i)%(this.colNum-1)==0) {
                        subTd.appendChild(this.organizeP(_values[j]));
                    }
                }
                tr.appendChild(subTd);
            }
        }
    }
    layer.getSubData=function(_value,text){
        var val='^'+_value+'|';
        var index=this.data.indexOf('^'+_value+'|');
        val=this.data.substr(index+val.length);
        var lasti=val.indexOf('$');
        lasti=(lasti==-1?val.length:lasti);
        val=val.substr(0,lasti);
        val=val.split('|');
        var subColNum=(val.length>16?2:1);//设置子层上的列数
        var hid=EHR.$(window.config.hidSave);
        var checkedStr="",selectedVals="";
        if(window.config.selectedVal)selectedVals=window.config.selectedVal;//保存在隐藏字段中的值 
        this.createTable();
        if (window.config.isNewVer) {
            this.createSubTable();
        }   
        var tr=this.tbl.insertRow(-1);
        var td=document.createElement('td');
        td.colSpan=subColNum;
        if(window.config.isMulti){            
            if(selectedVals!="")checkedStr=(selectedVals.indexOf('$'+text+'|'+_value+'$')<0?"":" checked='checked' ");
            //新逻辑：大类选中时，小类也可选择
            if (window.config.isNewVer) {
//                td.innerHTML="<input type='checkbox' "+checkedStr+" onclick='setObjValNew(\""+text+"\",\""+_value+"\")' id='EHRLayerCHK"+_value+"' name='EHRLayerCHK"+_value+"'/><label for='EHRLayerCHK"+_value+"'>"+text.replace("&","&amp;")+"</label>";
                td.innerHTML="<a href='javascript:void(0);' e='f' onclick='setObjValNew(\""+text+"\",\""+_value+"\")' id='EHRLayerCHK"+_value+"'>"+text.replace("&","&amp;")+"</a>";
            }else {
                td.innerHTML="<input type='checkbox' "+checkedStr+" onclick='setObjValFun_P(this,\""+text+"\",\""+_value+"\")' id='EHRLayerCHK"+_value+"' name='EHRLayerCHK"+_value+"'/><label for='EHRLayerCHK"+_value+"'>"+text.replace("&","&amp;")+"</label>";
            }
            td.setAttribute('t','g');
        }else{
            td.innerHTML=text.replace("&","&amp;");
        }
        td.className='Common_jobs_fbf13';
        td.setAttribute('d','e')
        //td.setAttribute("_value",_value);
        tr.appendChild(td);        
        tr=this.tbl.insertRow(-1);        
        for(var i=0;i<val.length;i++){
            var vals=val[i].split('^');
            if(i!=0&&i%subColNum==0){
                tr=this.tbl.insertRow(-1);
            }
            var td=document.createElement('td');
            if(window.config.isMulti){
                //新逻辑：大类选中时，小类也可选择
                if (window.config.isNewVer) {
                    if(selectedVals!="")checkedStr=(selectedVals.indexOf('$'+vals[0]+'|'+vals[1]+'$')<0?"":" checked='checked' ");
//                    vals[0]="<input type='checkbox' "+checkedStr+" onclick='setObjValNew(\""+vals[0]+"\",\""+vals[1]+"\")' id='EHRLayerCHK"+vals[1]+"' name='EHRLayerCHK"+vals[1]+"'/><label for='EHRLayerCHK"+vals[1]+"'>"+vals[0].replace("&","&amp;")+"</label>";
                    vals[0]="<a href='javascript:void(0);' e='f' onclick='setObjValNew(\""+vals[0]+"\",\""+vals[1]+"\")' id='EHRLayerCHK"+vals[1]+"'>"+vals[0].replace("&","&amp;")+"</a>";
                }else{
                    if(selectedVals!="")checkedStr=(selectedVals.indexOf('$'+vals[0]+'|'+vals[1]+'$')<0?(selectedVals.indexOf('$'+text+'|'+_value+'$')<0?"":" disabled "):" checked='checked' ");
                    vals[0]="<input type='checkbox' "+checkedStr+" onclick='setObjValFun(\""+vals[0]+"\",\""+vals[1]+"\")' id='EHRLayerCHK"+vals[1]+"' name='EHRLayerCHK"+vals[1]+"'/><label for='EHRLayerCHK"+vals[1]+"'>"+vals[0].replace("&","&amp;")+"</label>";
                }
                
            }else{
                if(selectedVals!=""&&(selectedVals==vals[0]+"|"+vals[1])){
                    td.className = window.config.subDivMOverClass||window.config.divMOverClass;
                }
                td.vtext=vals[0];
                td.vval=vals[1];
                td.onclick=function(evt){setObjValFun(this.vtext,this.vval);}
                //vals[0]="<div onclick='setObjValFun(\""+vals[0]+"\",\""+vals[1]+"\")'>"+vals[0]+"</div>";                
            }
            td.innerHTML=vals[0].replace("&","&amp;");            
            //td.setAttribute('_value',vals[1]);
            td.setAttribute('t','g');
            tr.appendChild(td);
        }        
        return this.tbl;
    }
    layer.organizeTd=function(_value,isLast,isChecked){
        var td=document.createElement('td');
        //td.setAttribute('_value',_value);
        td.setAttribute('t','g');
        var index=this.data.indexOf('^'+_value+'|');
        var val=this.data.substr(0,index);
        var thisObj=this;
        if(window.config.funType=="Fun"||window.config.funType=="Major"){
            val=val.indexOf('$')>0?val.substr(val.lastIndexOf('$')+1):val;            
            td.onclick=function(event){EHR.showSubLayer(this,event,thisObj.getSubData(_value,val));}
        }
        else{
            val=val.substr(val.lastIndexOf('|')+1);
            var hid=EHR.$(window.config.hidSave);
            var checkedStr="",selectedVals="";
            if(hid)selectedVals=hid.value;//保存在隐藏字段中的值
            if(selectedVals!="")checkedStr=(selectedVals.indexOf(','+val+'|'+_value+',')<0?"":" checked='checked' ");
            val="<input type='checkbox' "+checkedStr+" onclick='setObjValFun(\""+val+"\",\""+_value+"\",this)' id='EHRLayerCHK"+_value+"' name='EHRLayerCHK"+_value+"'/><label for='EHRLayerCHK"+_value+"'>"+val+"</label>";
        }
        td.innerHTML=val.replace("&","&amp;");
        return td;
    }
    layer.organizeP=function(_value,isLast,isChecked){
        var p=document.createElement('p');
        //td.setAttribute('_value',_value);
        p.setAttribute('t','g');
        p.onmouseover = function(event) { if (window.config.divMOverClass)this.className=window.config.divMOverClass; };
        p.onmouseout = function(event) { if (window.config.divMOutClass)this.className=window.config.divMOutClass; };
        var i=document.createElement('i');
        i.className='icon12Add';
        p.appendChild(i);
        var val = EHR.GetValueByCode(_value,this.data);
        var thisObj=this;
        if(window.config.funType=="Fun"||window.config.funType=="Major"){           
            p.onclick=function(event){EHR.showSubLayer(this,event,thisObj.getSubData(_value,val));}
        }
        else{
            val="<label><a onclick='setObjValNew(\""+val+"\",\""+_value+"\",this)' e='f' id='EHRLayerCHK"+_value+"'>"+val+"</a></label>";
        }
        p.innerHTML=val.replace("&","&amp;");
        return p;
    }

    layer.createBottomLine=function(){
        var tr=this.tbl.insertRow(-1);
        var td=document.createElement('td');
        td.colSpan=this.colNum;
        td.className='bottomLine';
        td.style.height="4px";
        tr.appendChild(td);
    }
    layer.createTitleTr=function(){
        var titleTr=this.tbl.insertRow(-1);
        titleTr.className='title';
        titleTr.onmouseover=function(e){EHR.setDragNode(this,1);}
        var titleHTML=window.config.title||'';		
		var titleTd=document.createElement('td');
		titleTd.colSpan=this.colNum;		
		titleTd.style.background="url('"+ImagePath+"title_bg.gif') repeat scroll 0 0 transparent";
		titleTd.innerHTML=titleHTML;
		titleTr.appendChild(titleTd);
    }
    layer.createTable=function(){
        var tbl=document.createElement('table');
        tbl.cellSpacing=0;
        tbl.cellPadding=0;
        tbl.border=0;
        tbl.style.fontSize="12px";
        tbl.style.backgroundColor='#FFFFFF';
        this.tbl=tbl;
    }
    layer.createTableNew=function(){
        var tbl=document.createElement('table');
        tbl.cellSpacing=2;
        tbl.cellPadding=0;
        tbl.border=0;
        tbl.width='100%';
        tbl.className=window.config.subTableClass;
        this.tbl=tbl;
    }
    layer.createSubTable=function(){
        var tbl=document.createElement('table');
        tbl.cellSpacing=0;
        tbl.cellPadding=0;
        tbl.border=0;
        tbl.className="Common_subLayer";
        this.tbl=tbl;
    }

    layer.createTitleBottom=function(fullLang){
        if ( this.isMulti ) {
            var divTitleBottom = document.createElement('div');
            divTitleBottom.className="Common_titleBottom";
            var b = document.createElement('b');
            b.className="Common_titlebot_th";
            switch (window.config.uniqueId) {
                case 'fun':
                    b.innerHTML=(fullLang=='Chinese'?'已选职能':'Selected Function');
                    break;
                case 'major':
                    b.innerHTML=(fullLang=='Chinese'?'已选专业':'Selected Major');
                    break;
                case 'ind':
                    b.innerHTML=(fullLang=='Chinese'?'已选行业':'Selected Industry');
                    break;
                default:
                    b.innerHTML='';
                    break;
            }
            divTitleBottom.appendChild(b)
            var divSelectedfun = document.createElement('div');
            divSelectedfun.id = "funSelectedTd"+(window.config.uniqueId||'');
            divSelectedfun.style.display='inline';
            divTitleBottom.appendChild(divSelectedfun);
            return divTitleBottom;
        }
        return '';
    }

    layer.createTitle=function() {
        if (window.config.title) {
            var h =document.createElement('h2');
            //h.onmouseover=function(e){EHR.setDragNode(this,1);}
            h.innerHTML=window.config.title;
            return h;
        }
        return '';
    }
    EHR.$=function(objOrId) {
        if (typeof objOrId == 'string' && document.getElementById(objOrId) != null ) {
            return document.getElementById(objOrId);
        }
        else if(typeof objOrId=='object')
        {
            return objOrId;
        }
        return null;
    }
    EHR.openDivMask=function(isBigMask,div){
        var objMask = this.$("EHRDivMask"+(window.config.uniqueId||''));
        if(objMask&&div&&objMask.parentNode!=div){//遮罩父对象不相同时移除重新添加
            objMask.parentNode.removeChild(objMask);
            objMask=null;
        }
        if(!objMask){
	        objMask = document.createElement("iframe");
	        objMask.id = "EHRDivMask"+(window.config.uniqueId||'');
	        if(isBigMask){
	            document.body.appendChild(objMask);
	        }else{
	            div.appendChild(objMask);
	        }
	    }        
        this.setTransMask(objMask,isBigMask);        
        return objMask;    
    }
    EHR.setTransMask=function(objMask,isBigMask){
        var oS = objMask.style; 
        oS.top = oS.left = oS.margin = oS.padding = "0px";oS.width='0px';oS.height='0px';oS.border="0px";
        if(isBigMask){//如果是大遮罩则加入全屏遮罩，否则遮罩放在层后边与层同样大小
            if(EHR.version==0){//ff            
                var wh;
                if(document.body.scrollWidth<document.documentElement.offsetWidth){
		             wh = document.documentElement.offsetWidth + "px";
	            }
	            else{
		            wh = document.body.scrollWidth + "px";
	            }
	            oS.width =wh;
	        }
	        else{//ie
	            oS.width = parseInt(this.getPageWHT.width())+"px";
	        }
            oS.height = parseInt(this.getPageWHT.pageHeight())+"px";
        }
        oS.position = "absolute";        
        oS.zIndex =isBigMask?400:-111;
        if(!window.config.isNewVer) oS.background = "#ffffff";
        oS.filter = "alpha(opacity=50)";
        oS.opacity = 50/100;
        oS.MozOpacity = 50/100;
    }
    EHR.maskSynDiv=function(maskObj,div){
        maskObj.style.width=div.offsetWidth+"px";
        maskObj.style.height=div.offsetHeight+"px";
    }
    EHR.setContent=function(div,content){
        if(content!=undefined&&(content.nodeName||typeof content=='string')&&this.removeContent(div)){            
            if(content.nodeName){
                div.appendChild(content);
            }
            else{
                div.innerHTML=content+"";
            }
            return true;
        }
        return false;
    }
    EHR.setContentNew=function(div,content,title,titleBouttom){
        var strMaxinum = "";
        if(lang=="en")
        {
            strMaxinum = "Maximum {0}";
        }
        else
        {
            strMaxinum = "最多可选{0}项";
        }
        
        if(content!=undefined&&(content.nodeName||typeof content=='string')&&this.removeContent(div)){            
            if(content.nodeName){
                if(title!=='') div.appendChild(title);
                if(titleBouttom!=='') div.appendChild(titleBouttom);
                div.appendChild(content);
            }
            else{
                div.innerHTML=window.config.title;
                div.appendChild(title);
                div.innerHTML=content+"";
            }
            /*可写入资源文件中*/
            EHR.CeratAlertDiv(div,strMaxinum.format(window.config.maxSelectNum))
            return true;
        }
        return false;
    }

    //弹层上面的弹层显示（跟随对象，提示文字）
    EHR.CeratAlertDiv = function(obj,txt) {
        var div = document.createElement("div");
        div.id=obj.id+"DivAlert";
        div.className="Common_page-dmaxnumble";
        var lbl = document.createElement('lable');
        lbl.className="Common_page-lmaxnumble";
        lbl.innerHTML=txt;
        div.appendChild(lbl);
        obj.appendChild(div);
    }
    EHR.removeContent=function(div){
        try{
            for(var i=0;i<div.childNodes;i++){
                div.removeChild(div.childNodes[i]);
            }
            div.innerHTML='';
            return true;
        }catch(ex){}
        return false;
    }
    EHR.showSubLayer=function(pNode,event,getSubFun,val){
        var EHRSubDiv=this.createSubDiv(pNode);
        if(EHRSubDiv.style.display=='block')
        {
            EHRSubDiv.style.display='none';
            EHRSubDiv.style.visibility='hidden';
            EHRSubDiv.innerHTML='';
        }    
        var subData=typeof getSubFun=='object'?getSubFun:(window[getSubFun]==undefined?'<div class="jobs_noSubData">没有子数据</div>':window[getSubFun].apply(this,[val]));
        this.setContent(EHRSubDiv,subData);//设置子层数据
        EHRSubDiv.style.visibility='visible';
        EHRSubDiv.style.display='block';
        if(EHR.version>0&&EHR.version<=6){//ie6加入遮罩
            var maskObj=document.createElement('iframe');
            maskObj.id="EHRDivMaskSub"+(window.config.uniqueId||'');
            EHRSubDiv.appendChild(maskObj);        
            this.setTransMask(maskObj,0);        
            maskObj.style.display='block';//show mask div        
            this.maskSynDiv(maskObj,EHRSubDiv);
        }
        this.fallowMouse(event,EHRSubDiv);
    }
    EHR.createSubDiv=function(pNode){
        var EHRSubDiv = this.$("EHRSubDiv"+(window.config.uniqueId||''));
        if(!EHRSubDiv){
            EHRSubDiv=document.createElement("div");
            EHRSubDiv.id='EHRSubDiv'+(window.config.uniqueId||'');
            document.body.appendChild(EHRSubDiv);
        }
        EHRSubDiv.className=window.config.subDivClass;
        EHRSubDiv.onmouseover = function(event) { EHR.subDivMouseOver( this,pNode,event ); }
	    EHRSubDiv.onmouseout = function(event) { EHR.subDivMouseOut( this,pNode,event); }
        
        return EHRSubDiv;
    }
    EHR.subDivMouseOver=function(obj,pNode,el){
        pNode.className = window.config.subDivMOverClass||window.config.divMOverClass;
        obj.style.display='block';
        var boxDiv=this.$('EHRDivBox'+(window.config.uniqueId||''));
        if (!window.config.isNewVer) {
            this.highlight(el,boxDiv);
        }
        boxDiv.canClose=false;
    }
    EHR.subDivMouseOut=function(obj,pNode,el){
        var curObj=this.getEventSrc(el);
		if(pNode!=curObj){
		    pNode.className = window.config.subDivMOutClass||window.config.divMOutClass;	    
		}
        if(obj)obj.style.display='none';
        var boxDiv=this.$('EHRDivBox'+(window.config.uniqueId||''));
        if (!window.config.isNewVer) {
            this.recoverBg(el,boxDiv);
        }
        boxDiv.canClose=false;
    }
    EHR.highlight=function(sEle,obj){//鼠标移至此项样式变化
        var mEle=this.getEventSrc(sEle);
        if(mEle.parentNode&&mEle.parentNode.tagName.toLowerCase()=='td')mEle=mEle.parentNode;//防止td内部有<b>等的内部标签,鼠标移入时此td不变色
        if(mEle.tagName.toLowerCase()=='td'){               
//            if(mEle.getAttribute("type")==null||mEle.getAttribute("type").toLowerCase()!='group'){//大类则不显示样式        
            if(mEle.getAttribute("t")!=null&&mEle.getAttribute("t").toLowerCase()=='g'){//大类则不显示样式 
                mEle.className = window.config.divMOverClass;
            }
            if (mEle.getAttribute("d")!=null&&mEle.getAttribute("d").toLowerCase()=='e') {
                mEle.className = window.config.divMOverClass +" Common_jobs_fbf13";
            }
        }
    }        
    EHR.recoverBg=function(sEle,obj){//鼠标移开后恢复原样式
	    var mEle=this.getEventSrc(sEle);
	    if(mEle.parentNode&&mEle.parentNode.tagName.toLowerCase()=='td')mEle=mEle.parentNode;
	    var EHRSubDiv=this.$('EHRSubDiv'+(window.config.uniqueId||''));
        if(mEle.tagName.toLowerCase()=='td'){
//            if(mEle.getAttribute("type")==null||mEle.getAttribute("type").toLowerCase()!='group'){
            if(mEle.getAttribute("t")!=null&&mEle.getAttribute("t").toLowerCase()=='g'){
                mEle.className =window.config.divMOutClass;                
                if(EHRSubDiv&&EHRSubDiv.style.display=='block'){
                    EHRSubDiv.style.display='none';
                }
            }
            if (mEle.getAttribute("d")!=null&&mEle.getAttribute("d").toLowerCase()=='e') {
                mEle.className = window.config.divMOutClass +" Common_jobs_fbf13";
            }
        }
        setTimeout(function(){
            if(obj&&(window.config.isAutoClose||false)&&obj.canClose){
                obj.style.display='none';
            }
        },50);
    }        
    EHR.getSrcItem=function(sEle,isSub){//鼠标点击此项赋值给相应文本框
        if(!EHR.IsLeftButton(sEle))return;//是否是鼠标左键
	    var mEle=this.getEventSrc(sEle);        
        if(mEle.tagName.toLowerCase()=='td'){
            var content=(mEle.innerText?mEle.innerText:mEle.textContent);
            //this.closeDivBox(isSub);
            return content;
        }
    }
    EHR.getEventSrc=function(evt){var e=evt||window.event;return e.target?e.target:e.srcElement;}
    EHR.getStrLength=function(value){  
	    var str,Num = 0;
	    for (var i=0;i<value.length;i++){
		    str = value.substring(i,i+1);
		    if (str<="~")  //对双字节字特殊处理
			    Num+=1;
		    else
			    Num+=2;
	    }
	    return Num;
    }
    EHR.getSubString=function(val,maxLength,str) {
       var currentStr="";
       if(val.length==0){return '';}
          for(var i=0,len=val.length;i<len;i++) {
               currentStr+=val.charAt(i);
               if(this.getStrLength(currentStr)>maxLength){
                      currentStr=val.substr(0,i);
                      return currentStr+(str||"...");
               }
         }
         return currentStr;
    }
    EHR.getPos =function(obj){//获取位置
		var left = 0 , top = 0;
		while (obj) {
			left += obj.offsetLeft;
			top += obj.offsetTop;
			obj = obj.offsetParent;			
		}
		return {left:left,top:top};
	}
    EHR.setToObj=function(followObj,div){
        var followParent=this.$(followObj.id);
        var h=followParent.offsetHeight;  
        var w=followParent.offsetWidth;    
        var lt=this.getPos(followParent);        
        var ow=parseInt(div.offsetWidth)/2+parseInt(w)/2;
        if(typeof followObj=='object'){
            ow+=followObj.w?parseInt(followObj.w):0;
            h+=followObj.h?parseInt(followObj.h):0;
        }
        div.style.left=(parseInt(lt.left)-ow)+"px";
        div.style.top=(lt.top+h) + "px";
    }        
	EHR.fallowMouse = function(e,obj,dir){//鼠标定位
		e = e || window.event;		
		dir = dir || { left: false , top: false };
		var ex = e.clientX;
		var ey = e.clientY;
		var bl = document.body.scrollLeft || document.documentElement.scrollLeft;
		var bt = document.body.scrollTop || document.documentElement.scrollTop;
		var bw = document.body.offsetWidth || document.documentElement.offsetWidth;
//		var bh = document.documentElement.clientHeight;
		var bh = this.getPageWHT.height();
		var ow = obj.offsetWidth;
		var oh = obj.offsetHeight;
		var ol = dir.left ? ( ex - ow < bl ? ex + bl : ex + bl - ow ) : ( ex + ow > bw ? ex + bl - ow : ex + bl );
		ol = Math.max( 0 , bl , ol );
		var ot = dir.top ? ( ey - oh < bt ? ey + bt : ey + bt - oh ) : ( ey + oh > bh ? ey + bt - oh : ey + bt );
		ot = Math.max( 0 , bt , ot );		
		obj.style.left = ol + 'px';
		obj.style.top = ot + 'px';
	}
	EHR.closeDivBox=function(isSub){
        var maskobj=this.$('EHRDivMask'+(window.config.uniqueId||''));
        if(maskobj)maskobj.style.display='none';//hide mask div   
        var div=this.$('EHRDivBox'+(window.config.uniqueId||''));
        div.style.display='none';
        div.style.visibility='hidden';
        if(isSub){
            var subDiv=this.$('EHRSubDiv'+(window.config.uniqueId||''));
            if(subDiv){
                subDiv.style.display='none';
                subDiv.style.visibility='hidden';
            }
        }
    }    	
    EHR.setDragNode=function(obj,isHasParent){    
        var movex=0;
        var movey=0;
        var movetop=0;
        var moveleft=0;
        var moveable=true;    
        if(EHR.version>0&&EHR.version<=6)
        {
            movetop=document.documentElement.scrollTop;
        }
        var dragparent=(isHasParent?this.$('EHRDivBox'+(window.config.uniqueId||'')):obj.parentNode);
        var sw=dragparent.scrollWidth;
        var sh=dragparent.scrollHeight;
        var clientW=this.getPageWHT.width();
        var clientH=this.getPageWHT.height();
        var scrollT=this.getPageWHT.scrollTop();
        var scrollL=document.documentElement.scrollLeft;
        obj.style.cursor='move';
        obj.onmouseover=function(){
            obj.style.cursor='move';
        };
        obj.onmousedown=function(e){            
            e=window.event?window.event:e;
            if (e.button==1 || e.button==0){//左中键时可拖动
                moveable=true;
            }else{return;}
            var oleft=dragparent.offsetLeft;
            var otop=dragparent.offsetTop-movetop;
            movex=e.clientX-oleft;
            movey=e.clientY-otop;   
            
            obj.onmousemove=function(e){
                if(moveable){
                    e=window.event?window.event:e;
                    var leftx=e.clientX-movex;
                    var topy=e.clientY-movey;
                    if(leftx>0&&(leftx+sw<clientW+scrollL)&&topy>0&&(topy+sh<clientH+scrollT)){
                        dragparent.style.left=leftx+'px';               
                        dragparent.style.top=parseInt(topy+movetop)+'px';
                        dragparent.style.margin='auto';
                    }                
                }
            }
            obj.onmouseup=function(){
                moveable=false;
            }   
            dragparent.onmouseup=function(){
                moveable=false;
            }
            document.onmouseup=function(){moveable=false;}
            obj.onselectstart=function(){return false;}//divTitle is not optional    
            dragparent.onselectstart=function(){return false;}    
        };  
        obj.onmouseout=function(){
            obj.style.cursor='default';
            moveable=false;
        }
    }
    EHR.setBoxPosition=function(box,width,height){        
        var cw=this.getPageWHT.width();
        var ch=this.getPageWHT.height();
        var sh=this.getPageWHT.scrollTop();
        var sl=document.documentElement.scrollLeft;
        var boxw=(box.offsetWidth||950);
        if(parseInt(width)>0){
            boxw=width>=950?950:width;
        }
        var boxh=(box.offsetHeight||600);
        if(parseInt(height)>0){
            boxh=height>=600?600:height;
        }
        var boxTop=parseInt(ch)/2+sh;
        var boxMarginTop=-(parseInt(boxh)/2);
        if(boxTop+boxMarginTop<0)
        {
            boxTop=0;
            boxMarginTop=0;
        }
        var boxLeft=parseInt(cw)/2;
        var boxMarginLeft=-(parseInt(boxw)/2);
        if(boxLeft+boxMarginLeft<0)
        {
            boxLeft=0;
            boxMarginLeft=0;
        }
        box.style.left=boxLeft+'px';
        box.style.top=boxTop+'px';
        box.style.marginTop=boxMarginTop+'px';
        box.style.marginLeft=boxMarginLeft+'px';
    }
    EHR.getPageWHT=function(){
        return{
		    scrollTop:function(){return document.body.scrollTop||document.documentElement.scrollTop},
		    width:function(){return self.innerWidth||(document.documentElement.clientWidth||document.body.clientWidth)},
		    height:function(){return self.innerHeight||(document.documentElement.clientHeight||document.body.clientHeight)},
		    pageHeight:function(){
			    var d=document, b=d.body, e=d.documentElement;
			    return Math.max(Math.max(b.scrollHeight,e.scrollHeight),Math.max(b.clientHeight,e.clientHeight))
		    },
		    pageWidth:function(){
			    var d=document, b=d.body, e=d.documentElement;
			    return Math.max(Math.max(b.scrollWidth,e.scrollWidth),Math.max(b.clientWidth,e.clientWidth))
		    }
	    }
    }()
    EHR.iAddEvent=function(o,evt,evtName){
        var onevt="on"+evt;
        if(o.addEventListener){//ff
            o.addEventListener(evt,evtName,false);
        }
        else if(o.attachEvent){//ie
            o.attachEvent(onevt,evtName);
        }
        else{
            onevt[evt]=evtName;
        }
    }

    EHR.GetValueByCode = function (code, dict) {
        if (dict.indexOf(code) > 0) {
            var a = dict.substring(0, dict.indexOf(code));
            if (a.indexOf('$') < 0 && a.indexOf('|') < 0) {
                return a.split('^')[0];
            }
            else {
                var b = a.substring(a.lastIndexOf('|') + 1, dict.indexOf(code));
                if (b.indexOf('$') >= 0) {
                    b = b.substring(b.indexOf('$') + 1, ctFunType.indexOf(code))
                    return b.split('^')[0];
                } else {
                    return b.split('^')[0];
                }
            }
        }
        else {
            return '';
        }
    }

    EHR.IsLeftButton=function(evt){
        var e = window.event?window.event:evt;
        if(e.button==0)//左键
            return true;
        return false;    
    }
    EHR.AjaxLoadHide=function(id) {
        $("#eHRCommonMaskDivBackground"+id).remove();
        $("#eHRCommonDivShow"+id).remove();
    }

    EHR.AjaxLoadShow=function(id,content,maskZindex,divZindex,w,h,isAllMask)
    {
        $("#eHRCommonMaskDivBackground"+id).remove();
        $("#eHRCommonDivShow"+id).remove();
        var eHRCommonMaskDivBackground=$("<div id='eHRCommonMaskDivBackground"+id+"' style='background-color:#000;position:absolute;z-index:"+maskZindex+";opacity:0.6;filter:alpha(opacity=60);left:0;top:0;"+(isAllMask==1?"width:100%;height:100%":"width:"+w+"px;height:"+h+"px")+"'></div>");
        if(isAllMask==1){
            eHRCommonMaskDivBackground.css("height",$(document).height());
            eHRCommonMaskDivBackground.css("width",$(document).width());
        }
        eHRCommonMaskDivBackground.appendTo("body");
        var eHRCommonDivShow=$("<div id='eHRCommonDivShow"+id+"' style='position:absolute;z-index:"+divZindex+";left:0;top:0'><div style='background-color:#fff;width:"+w+"px;height:"+h+"px;border:1px solid #017dc7;'><div style='background-color:#fff;padding:10px;'>"+content+"</div></div><div style='background:url("+GLOBAL_IMAGEPATH+"inbox/layerClose.gif) no-repeat;z-index:"+divZindex+";position:absolute;top:5px;right:0;width:25px;height:25px;cursor:pointer;' onclick='EHR.AjaxLoadHide(\""+id+"\");'></div></div>");
        eHRCommonDivShow.appendTo("body");
        eHRCommonMaskDivBackground.bgiframe(); //解决ie6下拉框问题
        EHR.setBoxPosition(EHR.$("eHRCommonDivShow"+id),w,h);        
        if(isAllMask!=1){
            EHR.setBoxPosition(EHR.$("eHRCommonMaskDivBackground"+id),w,h);
        }
    }
    //公用ajax调用方法
    //strPostdata要传对象化的
    //增加一参数，showLoading：是否显示正在加载，undefined或1时显示
    EHR.Common_AsyncHandle=function(ajaxType,ajaxDataType,requestPage,strPostdata,succHandleFun,showLoading){
        $(document).ready(function()
        {
           $.ajax(
          {  
             type:ajaxType,
             async:true, 
             dataType: ajaxDataType,   
             url:"../Ajax/"+requestPage,
             data:strPostdata,
             beforeSend: function(XMLHttpRequest)
             {
                //EHR.AjaxLoadShow('m','<img src=""+GLOBAL_IMAGEPATH+"common/loading2.gif" style="padding-right:10px; height:25px; width:25px;vertical-align:middle;" alt=""/>处理中，请稍后...',100,101,200,50,1);
               if(typeof (showLoading) == 'undefined' || showLoading)
                EHR.ShowMaskDiv()
             },
             success:function(result)
             {
                //EHR.AjaxLoadHide('m');
              if(typeof (showLoading) == 'undefined' || showLoading)
                EHR.CloseMaskDiv();
                if(typeof(succHandleFun)=='function'){
                    succHandleFun(result);
                }else{         
                    var msgtype,returninfo;
                    if(ajaxDataType=="json"){
                        msgtype=result.msgtype;
                        returninfo=result.returninfo;
                    }else{
                        msgtype=$(result).find("msgtype").eq(0).text();
                        returninfo=$(result).find("returninfo").eq(0).text();                
                    }
                    
                    //如果没有传入要处理的回调函数则手动加入相关部分代码
                    //EHR.AjaxLoadShow('info','returninfo:'+returninfo,100,101,300,100,0);
                }
              },
              complete: function(XMLHttpRequest, textStatus)
              {
                   //EHR.AjaxLoadHide('m'); 
                 if(typeof (showLoading) == 'undefined' || showLoading)
                   EHR.CloseMaskDiv();
              },
              error: function(XMLHttpRequest, textStatus, errorThrown)
              { 
                   //EHR.AjaxLoadHide('m');
                 if(typeof (showLoading) == 'undefined' || showLoading)
                   EHR.CloseMaskDiv();
                   //记录错误日志

              }
           });
        });
        return false;
    }﻿
    /**  
    *记录简历搜索日志
    *pageno 页面号
    *eventno 事件号
    *logtype 日志方式
    *memo 其他参数或页面加载时间
    **/
    EHR.Common_AsyncAddLog=function(pageNo,eventNo,memo,logtype){
        //验证用key，未定义直接返回
        if(typeof(strKey)=="undefined")return;
        if(typeof(memo)=="undefined") memo="";
        if(typeof(logtype)=="undefined" || logtype=="") logtype="event";
        var img = new Image;
        img.src = "../Ajax/Common/GlobalActionLogAjax.ashx?logType="+logtype+"&pageNo="+pageNo+"&memo="+ encodeURIComponent(memo)+"&eventNo="+eventNo+"&Key="+strKey+"&rnd="+Math.random();
    }﻿ 
    EHR.GetPageLoadTime=function(pageNo){
       if(!pageLoadTime)return;//未定义加载时间，退出方法
        //window.onload = function subSomething() 
        { 
            //if(document.readyState == 'complete') //当页面加载状态 
            {
              EHR.Common_AsyncAddLog(pageNo,'',pageLoadTime,'pageView');
            } 
        }   
    }
    //正在操作遮面层
    EHR.InitMaskDiv = function () {
        div = "<div id='MaskDiv' style='display:none;position:absolute;top:0;left:0;width:100%;height:100%;background-color:#000000;z-index:1003;-moz-opacity:.3;opacity:.50;filter:alpha(opacity=30)'></div>"
        + "<div><div id='MyDiv' style='display:none;position:absolute;z-index:1004;overflow:hidden;-moz-opacity:.5;opacity:.50;filter:alpha(opacity=50);text-align:center;vertical-align:middle;'>"
        + "<img src='" + ImagePath + "commonnew/loading.gif' style='padding-right: 10px; vertical-align: middle;'alt='' /></div></div>"
        if ($('#MaskDiv').length <= 0) {
            $(document.body).append(div);
        }
    }
        //弹出隐藏层
    EHR.ShowMaskDiv = function () {
        //MoveToCenter(document.getElementById('MyDiv')); 
        var myDiv = document.getElementById("MyDiv");
        if (!myDiv) {
            EHR.InitMaskDiv();
        }
        myDiv = document.getElementById("MyDiv");
        var ch = pageWidthHeight.height();
        var sh = pageWidthHeight.scrollTop();
        myDiv.style.left = '50%';
        myDiv.style.top = (parseInt(ch) / 2 + sh) + 'px';
        myDiv.style.display = 'block';
        document.getElementById("MaskDiv").style.display = 'block';
        var bgdiv = document.getElementById("MaskDiv");
        bgdiv.style.width = document.body.scrollWidth;
        // bgdiv.style.height = $(document).height();
        $("#MaskDiv").height($(document).height());
    }
   //关闭弹出层
    EHR.CloseMaskDiv = function (show_div, bg_div) {
        document.getElementById("MyDiv").style.display = 'none';
        document.getElementById("MaskDiv").style.display = 'none';
    }
    //关闭遮罩层  maskID遮罩层的id
    EHR.CloseDivMask = function (maskID) {
        var objDialog;
        if (maskID)
            objDialog = document.getElementById(maskID);
        else objDialog = document.getElementById('DivBoxMask');
        if (objDialog) objDialog.style.display = "none";
    }
    EHR.CloseDivMaskTwo = function () {
        $("#DivBoxMaskTwo").hide();
    }

    //弹框遮罩层
    EHR.OpenDivMask = function () {
    $('#DivBoxMask').remove();

    var divMask = document.createElement("div");
    divMask.id = "DivBoxMask";
    divMask.style.top = divMask.style.left = divMask.style.margin = divMask.style.padding = "0px";
    var screenWidth;
    var screenHeight;
    if (document.body.scrollHeight < document.documentElement.clientHeight) {
        screenHeight = document.documentElement.clientHeight + "px";
    }
    else {
        screenHeight = document.body.scrollHeight + "px";
    }
    if (document.body.scrollWidth < document.documentElement.offsetWidthh) {
        screenWidth = document.documentElement.offsetWidth + "px";
    }
    else {
        screenWidth = document.body.scrollWidth + "px";
    }
    divMask.style.width = screenWidth;
    divMask.style.height = screenHeight;
    divMask.style.position = "absolute";
    divMask.style.zIndex = "401";
    divMask.style.background = "#000000";
    divMask.style.filter = "alpha(opacity=50)";
    divMask.style.opacity = 50 / 100;
    divMask.style.MozOpacity = 50 / 100;
    document.body.appendChild(divMask);
    divMask.style.display = "block";
    if (browser.msie && (parseInt(browser.version)) < 7) {
            var gIfr= document.createElement( 'iframe' );
            gIfr.style.top = gIfr.style.left = gIfr.style.margin = gIfr.style.padding = "0px";
            gIfr.style.width = screenWidth;
            gIfr.style.height = screenHeight;
            gIfr.style.background = "#000000";
            gIfr.style.filter = "alpha(opacity=0)";
            divMask.appendChild(gIfr);
     }
  }
            //操作提示弹框
        EHR.ShowBox = function (msg, width, cancel, onClick, LineBreak,OnCancelClick) {
            EHR.ShowMsg(msg, true, width, cancel, onClick,"", LineBreak,OnCancelClick);
        }
                //操作提示弹框
        EHR.ShowBoxTwo = function (msg, width, cancel, onClick, LineBreak,OnCancelClick) {
            EHR.ShowMsg(msg, true, width, cancel, onClick,"", LineBreak,OnCancelClick);
            if($('#DivBoxMask').length>0){
            $('#DivBoxMask').css('z-index',500);
//            $('#tip_msgbox').find('[onclick^="EHR.CloseMsg"]').each(function(){
//            $(this).attr('onclick','CloseMsgTwo()');
//            });
            $('#tip_msgbox').html($('#tip_msgbox').html().replace(/EHR.CloseMsg/g,'EHR.CloseMsgTwo'));
            }
        }
           EHR.CloseMsgTwo = function () {
            var msgBox = document.getElementById('tip_msgbox');
            if (msgBox != null) msgBox.style.display = "none";
            //if (OpenMask) this.CloseDivMask(maskID);
             if($('#DivBoxMask').length>0){
            $('#DivBoxMask').css('z-index',401);
            }
        }
	      //弹框上的遮罩层（弹层又弹层）
    EHR.OpenDivMaskTwo = function () {
    $('#DivBoxMaskTwo').remove();
    var divMask = document.createElement("div");
    divMask.id = "DivBoxMaskTwo";
    divMask.style.top = divMask.style.left = divMask.style.margin = divMask.style.padding = "0px";
    var screenWidth;
    var screenHeight;
    if (document.body.scrollHeight < document.documentElement.clientHeight) {
        screenHeight = document.documentElement.clientHeight + "px";
    }
    else {
        screenHeight = document.body.scrollHeight + "px";
    }
    if (document.body.scrollWidth < document.documentElement.offsetWidthh) {
        screenWidth = document.documentElement.offsetWidth + "px";
    }
    else {
        screenWidth = document.body.scrollWidth + "px";
    }
    divMask.style.width = screenWidth;
    divMask.style.height = screenHeight;
    divMask.style.position = "absolute";
    divMask.style.zIndex = "600";
    divMask.style.background = "#000000";
    divMask.style.filter = "alpha(opacity=50)";
    divMask.style.opacity = 50 / 100;
    divMask.style.MozOpacity = 50 / 100;
    document.body.appendChild(divMask);
    divMask.style.display = "block";
    if (browser.msie && (parseInt(browser.version)) < 7) {
            var gIfr= document.createElement( 'iframe' );
            gIfr.style.top = gIfr.style.left = gIfr.style.margin = gIfr.style.padding = "0px";
            gIfr.style.width = screenWidth;
            gIfr.style.height = screenHeight;
            gIfr.style.background = "#000000";
            gIfr.style.filter = "alpha(opacity=0)";
            divMask.appendChild(gIfr);
     }
  }
	
        /*
        Content:提示主体内容
        OpenMask：
        是否打开遮罩层：
        Width：自定义宽度
        Cancel：是否启用确定确认层
        OnClick：使用确定确认层时确定自定义事件
        Title:提示title
        LineBreak: 内容是否换行显示
        */
        EHR.ShowMsg = function (Content, OpenMask, Width, Cancel, OnClick, Title, LineBreak,OnCancelClick) {
            var tipTitle = "信息提示";
            var okText = "确定";
            var cancelText = "取消";
            if (lang == "en" || lang.toLowerCase() == "en-us" || lang.toLowerCase().indexOf('en') > -1) {
                tipTitle = "Message Tip";
                okText = "Confirm";
                cancelText = "Cancel";
            }
            var width = 195;
            var onCancelClick = "EHR.CloseMsg(" + OpenMask + ");"; 
            if(OnCancelClick) onCancelClick+=OnCancelClick; //取消按钮-自定义事件
            // var close  = "<a href=\"javascript:void(0);\" onclick=\"EHR.CloseMsg(" + OpenMask + ");\"><i class=\" Common_icon Common_icon_remove_white\"></i></a>"; //是否需要右上角关闭×
            var close  = "<a href=\"javascript:void(0);\" onclick='"+onCancelClick+"'><i class=\" Common_icon Common_icon_remove_white\"></i></a>"; //是否需要右上角关闭×
            if (Width) {
                width = Width; //自定义宽度
            }

            var onClick = "EHR.CloseMsg(" + OpenMask + ");"; //
            if (OnClick) onClick += OnClick; //确定按钮-自定义事件
            var cancel = "";
            if (Cancel) {//是否使用确定确认层
                //cancel = "<a href='javascript:void(0)' class='Common_panel_btn_s' onclick='EHR.CloseMsg(" + OpenMask + ");'>" + cancelText + "</a>";      
                cancel = "<a href='javascript:void(0)' class='Common_panel_btn_s' onclick='"+onCancelClick+"'>" + cancelText + "</a>";      
            }
            if (LineBreak) {
                LineBreak = "style='word-break:normal'";
            }
            else {
                LineBreak="";
            }
            if (Title) tipTitle = Title; //左上提示
            var msgBoxDiv = "<div class='Common_panel_lnp' id='tip_msgbox' style='z-index: 501; position: absolute;width:" + width + "px;'></div>"
            var html = "<h2><p>" + tipTitle + "</p>" + close + "</h2><div class='Common_panel_body'>"
            html += "<div class='Common_panelBtn_box MA_panel_0706'><p class=' hint' " + LineBreak +">" + Content + "</p>"
            html += "<span  class='Common_panel_btn_s' onclick='"+onClick+"' onmouseover='javascript:$(this).css({\"cursor\":\"pointer\",\"background-color\":\"#5191ce\",\"color\":\"#fff\"})' onmouseleave='javascript:$(this).css({\"background-color\":\"#fff\",\"color\":\"#5191ce\"})'>" + okText + "</span>"
            html += cancel;
            html += "</div></div>";
            $('#tip_msgbox').remove();
            var tipMsgBox = document.getElementById("tip_msgbox");
            if (tipMsgBox == null) {
                $(document.body).append(msgBoxDiv);
                tipMsgBox = document.getElementById("tip_msgbox");
            }
            tipMsgBox.innerHTML = html;
            tipMsgBox.style.display = "block";
            // 层窗口居中显示
            MoveToCenter(tipMsgBox);

            // 打开遮罩层
            if (OpenMask)
                this.OpenDivMask();
        }
        EHR.CloseMsg = function (OpenMask, maskID) {
            var msgBox = document.getElementById('tip_msgbox');
            if (msgBox != null) msgBox.style.display = "none";
            if (OpenMask) this.CloseDivMask(maskID);
        }
        //判断是否含html标签
        EHR.hasHtmlTag = function (val) {
            return /(<\/)|(<[a-zA-Z!])|(<\/[a-zA-Z!])/gim.test(val);
        }
        //弹出div框内容 并居中显示
        EHR.ShowDivBox = function (obj) {
            EHR.OpenDivMask();
            var top = document.documentElement.scrollTop == 0 ? document.body.scrollTop : document.documentElement.scrollTop || document.body.scrollTop;
            var screenTop = typeof (window.screenTop) == "undefined" ? 100 : window.screenTop;
            var scrrenHeight = ($(document).height() || $(document.body).height());
            top = (document.documentElement.clientHeight - $(obj).height()) / 2 + top;
            $(obj).css({ "position": "absolute", "z-index": "500", "left": (document.body.clientWidth - parseInt($(obj).width())) / 2, "width": $(obj).width(), "height": $(obj).height()-1, "top": top });
            $(obj).show();
            $(obj + " h2 a").bind("click", function () {
             EHR.CloseDivBox(obj);
            });
         }
        EHR.CloseDivBox = function (obj) {
           $(obj).hide();
           EHR.CloseDivMask();
       }
       EHR.ShowDivBoxTwo = function (obj) {
            EHR.OpenDivMaskTwo();
            var top = document.documentElement.scrollTop == 0 ? document.body.scrollTop : document.documentElement.scrollTop || document.body.scrollTop;
            var screenTop = typeof (window.screenTop) == "undefined" ? 100 : window.screenTop;
            var scrrenHeight = ($(document).height() || $(document.body).height());
            top = (document.documentElement.clientHeight - $(obj).height()) / 2 + top;
            $(obj).css({ "position": "absolute", "z-index": "700", "left": (document.body.clientWidth - parseInt($(obj).width())) / 2, "width": $(obj).width(), "height": $(obj).height()-1, "top": top });
            $(obj).show();
            $(obj + " h2 a").bind("click", function () {
             EHR.CloseDivBoxTwo(obj);
            });
         }
       EHR.CloseDivBoxTwo = function (obj) {
           $(obj).hide();
           EHR.CloseDivMaskTwo();
       }
       //防止恶意点击按钮 触发多次刷新页面
        EHR.AvoidPageRepeatRefresh = function () {
            $('#DivPageBoxMask').remove();
            var divMask = document.createElement("div");
            divMask.id = "DivPageBoxMask";
            divMask.style.top = divMask.style.left = divMask.style.margin = divMask.style.padding = "0px";
            var screenWidth;
            var screenHeight;
            if (document.body.scrollHeight < document.documentElement.clientHeight) {
                screenHeight = document.documentElement.clientHeight + "px";
            }
            else {
                screenHeight = document.body.scrollHeight + "px";
            }
            if (document.body.scrollWidth < document.documentElement.offsetWidthh) {
                screenWidth = document.documentElement.offsetWidth + "px";
            }
            else {
                screenWidth = document.body.scrollWidth + "px";
            }
            divMask.style.width = screenWidth;
            divMask.style.height = screenHeight;
            divMask.style.position = "absolute";
            divMask.style.zIndex = "1000";
            divMask.style.background = "#000000";
            divMask.style.filter = "alpha(opacity=1)";
            divMask.style.opacity = 0.01;
            divMask.style.MozOpacity = 0.01;
            document.body.appendChild(divMask);
            divMask.style.display = "block";
            if (browser.msie && (parseInt(browser.version)) < 7) {
            var gIfr= document.createElement( 'iframe' );
            gIfr.style.top = gIfr.style.left = gIfr.style.margin = gIfr.style.padding = "0px";
            gIfr.style.width = screenWidth;
            gIfr.style.height = screenHeight;
            gIfr.style.background = "#000000";
            gIfr.style.filter = "alpha(opacity=0.1)";
            divMask.appendChild(gIfr);      
         }
          $("body").attr("style","-moz-user-select:none");
      }
})();

String.prototype.getLen=function(){
    return this.replace(/[^\x00-\xff]/g,"aa").length;
}

Function.prototype.$EHRExtends=function($parent){
    if(typeof $parent=='function'){
        this.$parent=$parent;
        for(var prop in $parent.prototype){
            if(this.prototype[prop]==undefined){
                this.prototype[prop]=$parent.prototype[prop];
            }
        }
    }
    return this;
}

/*简历列表*/
window.EHRResumeList = {};
EHRResumeList.userColl = "";  //记录用户设置的显示字段

//回到搜索首页
EHRResumeList.ToSearchIndexPage = function (d) {
    window.location.href = "SearchResumeIndexNew.aspx";

};

//查看简历
EHRResumeList.SubmitToPage = function (page) {
    var url = gid("form1").action;
    gid("form1").target = "_blank";
    gid("form1").action = page;
    gid("form1").submit();
    gid("form1").target = "_self";
    gid("form1").action = url;
};

//全选及点击事件
EHRResumeList.GetSelectResumesNew = function (obj, pageno, pageevent) {
    this.GetSelectResumes(obj);
    if (obj.checked) {
        EHR.Common_AsyncAddLog(pageno, pageevent);
    }
}

//全选事件
EHRResumeList.GetSelectResumes = function (objBool) {
    this.DoSelectAll('chkBox', objBool.checked);
    gid('radSelactALLt').checked = objBool.checked;
    gid('radSelactALLd').checked = objBool.checked;
}

EHRResumeList.DoSelectAll = function (chkBoxName, value) {
    var chk = document.getElementsByName(chkBoxName);

    if (chk != null) {
        if (chk.length != null) {
            for (var i = 0; i < chk.length; i++) {
                chk[i].checked = value;
            }
        }
        else {
            chk.checked = value;
        }
    }
}

// 获取勾选的简历的USERID
EHRResumeList.GetSelectedUserID = function (chkBoxName,CheckIncalid) {
    var strSelectIDs;
    strSelectIDs = "";
    var chk;
    chk = document.getElementsByName(chkBoxName);

    if (chk != null) {
        if (chk.length != null) {
            for (var i = 0; i < chk.length; i++) {
                if (chk[i].type == "checkbox" && chk[i].checked) {
                    var invalid = isUndefined(chk[i].getAttribute("invalidResume"));
                    if (CheckIncalid && !invalid) { continue; }
                    if (strSelectIDs == "") {
                        if (chk[i].value != "") {
                            strSelectIDs = +chk[i].value;
                        }
                    }
                    else {
                        if (chk[i].value != "") {
                            strSelectIDs = strSelectIDs + "," + chk[i].value;
                        }
                    }
                }
            }
        }
        else {
            if (chk.type == "checkbox" && chk.checked) {
                strSelectIDs = chk.value;
            }
        }
    }
    return strSelectIDs;
}
// 获取勾选的简历的USERID
EHRResumeList.GetSelectedSeqID = function (chkBoxName,CheckIncalid) {
    var strSelectIDs;
    strSelectIDs = "";
    var chk;
    chk = document.getElementsByName(chkBoxName);

    if (chk != null) {
        if (chk.length != null) {
            for (var i = 0; i < chk.length; i++) {
                if (chk[i].type == "checkbox" && chk[i].checked) {
                    var invalid = isUndefined(chk[i].getAttribute("invalidResume"));
                    if (CheckIncalid && !invalid) { continue; }
                    var chkValue1 = chk[i].getAttribute("value1");
                    if (chkValue1 != null && chkValue1 != "" && chkValue1 != undefined) {
                        if (strSelectIDs == "") {
                            strSelectIDs = +chkValue1;
                        }
                        else {
                            strSelectIDs = strSelectIDs + "," + chkValue1;
                        }
                    }
                }
            }
        }
        else {
            if (chk.type == "checkbox" && chk.checked) {
                strSelectIDs = chk.value;
            }
        }
    }
    return strSelectIDs;
}
// 查看简历(单条/多条)--单条传入userid，多条不传参数，sourcecode代表当前页面的code,type传1代表需进入resumeviewfloder页面
//modify by zhoug 20170330
EHRResumeList.ShowResumeView = function (userid,sourcecode, type) {
    var objHid = gid("hidUserID");
    var objSeqIds = gid("hidSeqID");
    var pagecode = "";
    if(sourcecode&&sourcecode!="")
    {
        pagecode = "?pageCode="+sourcecode;
    }
    if(type==1)
    {
        if(objSeqIds)
            objSeqIds.value = this.GetSelectedSeqID('chkBox',true);
        else
            return false;
        if(objSeqIds.value.length>0)
        {
            gid("hidEvents").value = "";
            this.SubmitToPage("../Candidate/ResumeViewFolder.aspx"+pagecode);
        }
        else
        {
            EHR.ShowBox(Msg_SelectResume, 300);
            return false;
        }
    }
    else
    {
        if (objHid) {
            objHid.value = "";
        }
        else {
            return false;
        }

        if (userid && userid!='') {
            objHid.value = userid;
        }
        else {
            objHid.value = this.GetSelectedUserID('chkBox');
        }
        if (objHid.value.length > 0) {

            $("#hidSeqID").val("");
            gid("hidEvents").value = "21";
            // EHR.Common_AsyncAddLog('0', '24', "1" + objHid.value, '');
            this.SubmitToPage("../Candidate/ResumeView.aspx"+pagecode);
        }
        else {
            EHR.ShowBox(Msg_SelectResume, 300);
            return false;
        }
    }
    return false;
}
EHRResumeList.CheckNormalUserID = function () {
    var userid = "";
    var userList = $("#hidUserID").val().split(',');
    for (var i = 0; i < userList.length; i++) {
        if ($("[name='chkBox'][value='" + userList[i] + "']").attr("value1") != undefined) {
            userid += userList[i] + ",";
        }
    }
    if (userid == "") {
        EHR.ShowBox(Msg_SelectResume, 300);
        return false;
    }
    else {
        userid = userid.substring(0, userid.length - 1);
        $("#hidUserID").val(userid);
    }
    return true;
}
// 打开修改显示字段层
EHRResumeList.OpenUpdateColumDiv = function (objbtn) {
    var btn = objbtn;
    var t = objbtn.offsetTop;
    var l = objbtn.offsetLeft;
    var h = objbtn.offsetHeight;
    var w = objbtn.offsetWidth;
    while (objbtn = objbtn.offsetParent) {
        t += objbtn.offsetTop;
        l += objbtn.offsetLeft;
    }
    gid("DivCol").style.top = (t + h) + "px";
    if (varLang == "EN-US") {
        gid("DivCol").style.left = l + w - 498 + "px";
    }
    else {
        gid("DivCol").style.left = l + w - 464 + "px";
    }
    gid("DivCol").style.display = "block";
    EHR.OpenDivMask();
}

// 修改显示字段恢复
EHRResumeList.RestoreDefaultColDiv = function () {
    var chk = gid("cbxColumns").getElementsByTagName("Input");
    if (chk != null) {
        if (chk.length != null) {
            for (var i = 0; i < chk.length; i++) {
                if (i < 7) {
                    chk[i].checked = true;
                } else {
                    chk[i].checked = false;
                }
            }
        }
    }
}
// 修改显示字段确认检查
EHRResumeList.CloseColDiv = function (objid) {
    //判断选择项目大于10
    var chk = gid("cbxColumns").getElementsByTagName("Input");
    var j = 0;
    if (chk != null) {
        if (chk.length != null) {
            for (var i = 0; i < chk.length; i++) {
                if (chk[i].checked) {
                    j++;
                    if (j > 10) {
                        // 超出10个
                        EHR.ShowMsg(Msg_10Item,false,300);
                        return false;
                    }
                }
            }
        }
    }

    EHR.CloseDivBox("#"+objid);
    return true;
}

// 点击“展开”/“收起”按钮，显示/隐藏简历详细信息行
// objimg -- 图片对象; imgtype -- 1:展开 ; 2:收起
EHRResumeList.SetTrDetailDisplay = function (objIndex) {
    var trdetail = gid("trDetail_" + objIndex);    // 简历详细信息行
    var hidExp = gid("hidIsExp_" + objIndex);
    var imgtype = hidExp.value;
    if (imgtype == 0)  // 点击展开
    {
        hidExp.value = 1;
        trdetail.style.display = "";
        EHRResumeList.OnclickLoad(objIndex - 1);
    }
    else  // 点击收起
    {
        hidExp.value = 0;
        trdetail.style.display = "none";
    }
}

// 鼠标移入/移出行，颜色切换
// obj:当前对象 ; isInout:true(移入)/false(移出) ; ishighlight:true(高亮)/false(非高亮)
EHRResumeList.TrBgColorChange = function (obj, isInout, ishighlight) {
    var id = obj.id;
    if (id == "") return false;
    var objIndex = id.substring(id.lastIndexOf("_") + 1, id.length);
    if (objIndex == "") return false;
    var trbaseid = "trBaseInfo_" + objIndex;  // 简历基本信息行ID
    var trdetailid = "trDetail_" + objIndex;  // 简历详细信息行ID
    var tdOperation = "tdOperation_" + objIndex;  // 操作按钮

    if (!gid(trbaseid)) return false;
    if (isInout)  // 移入
    {
        gid(trbaseid).className = "inbox_tr_hover";        //简历基本信息行
        if (gid(trdetailid))   // 简历详细行存在
        {
            if (gid(trdetailid).style.display == "")  // 简历详细信息已显示
            {
                if (gid(tdOperation)) {
                    gid(tdOperation).style.display = "";       // 简历操作按钮层显示
                }
                if (browser.msie && parseInt(browser.version) < 7) {     //特殊处理IE6的操作按钮显示层
                    $("#" + id).find("div:first").find("div").eq(2).css("display", "block");
                    $("#" + id).find("div:first").find("div").eq(2).css("width", "1000px");
                }
            }
            else  // 简历详细信息未显示
            {
                if (gid(tdOperation)) gid(tdOperation).style.display = "none"; // 简历操作按钮层不显示
            }
        }
    }
    else  // 移出
    {
        if (ishighlight)  // 高亮
        {
            gid(trbaseid).className = "inbox_tr_light";  // 行高亮设置
        }
        else if (!gid(trdetailid) || gid(trdetailid).style.display == "none")  // 详细行未展开
        {
            if (parseInt(objIndex) % 2 == 0)   // 双数行
            {
                gid(trbaseid).className = "inbox_tr2";
            }
            else  // 单数行
            {
                gid(trbaseid).className = "inbox_tr1";
            }
        }
        else if (gid(trdetailid).style.display == "")  // 详细行展开
        {
            gid(trbaseid).className = "inbox_tr_hover";
            if (browser.msie && parseInt(browser.version) < 7) {    //特殊处理IE6的操作按钮显示层
                $("#" + id).find("div:first").find("div").eq(2).css("display", "none");
            }
        }

        if (gid(tdOperation)) {
            gid(tdOperation).style.display = "none"; // 简历操作按钮层不显示
        }
    }
}

//----------AJAX读取简历XML文件-----------
EHRResumeList.arrays = []; //参数数组
//应聘管理 start
EHRResumeList.V_GetResumeContentOffer = function (userID, strKey, hasPic, strSex, downEnabled, strTopSchool, strLang, rownum, jobName, companyName, divisionName, jobArea, workArea) {
    if ($("#divResult_" + rownum).html() != "") {
        return;
    }
    var indexNode = $("#trDetail_" + rownum).prev(); //的到最终要获取的节点.
    var node = indexNode[0]; //转为dom对象
    this.arrays.push({ userID: userID, strKey: strKey, hasPic: hasPic, strSex: strSex, strTopSchool: strTopSchool, strLang: strLang, node: node, "isOffer": 1, rownum: rownum, jobName: jobName, companyName: companyName, divisionName: divisionName, jobArea: jobArea, workArea: workArea });
}
// 点击“展开”/“收起”按钮，显示/隐藏简历详细信息行
// objimg -- 图片对象; imgtype -- 1:展开 ; 2:收起
EHRResumeList.SetTrDetailDisplayOff = function (objIndex) {
    var trdetail = gid("trDetail_" + objIndex);    // 简历详细信息行
    var hidExp = gid("hidIsExp_" + objIndex);
    var trBaseInfo = $("#trBaseInfo_" + objIndex+" td:first"); 
    var trBaseInfoclass = $("#trBaseInfo_" + objIndex+" td:first").attr("class");
    var imgtype = hidExp.value;
    if (imgtype == 0)  // 点击展开
    {
        hidExp.value = 1;
        trdetail.style.display = "";      
        EHRResumeList.GetDataByAjaxOffer(this.arrays[objIndex-1]);
    }
    else  // 点击收起
    {
        hidExp.value = 0;
        trdetail.style.display = "none";
    }
}
EHRResumeList.GetDataByAjaxOffer = function (row) {
    var rownum = row.rownum;
    if ($("#divResult_" + rownum).html() != "") {
        return;
    }
    var userID = row.userID;
    var strKey = row.strKey;
    var strLang = row.strLang;
    var hasPic = row.hasPic;
    var strSex = row.strSex;
    var strTopSchool = row.strTopSchool;
    var strOfferHtml = "";
    if (row.jobName != "") {
        strOfferHtml += decodeURIComponent(row.jobName) + " |&nbsp;&nbsp;";
    }
    if (row.companyName != "") {
        strOfferHtml += decodeURIComponent(row.companyName);
        if (row.divisionName != "") {
            strOfferHtml += "-" + decodeURIComponent(row.divisionName);
        }
        strOfferHtml += " |&nbsp;&nbsp;";
    }
    if (row.jobArea) {
        strOfferHtml += row.jobArea + " |&nbsp;&nbsp;";
    }
    if (row.workArea) {
        strOfferHtml += row.workArea + " |&nbsp;&nbsp;";
    }
    if (strOfferHtml != "") {
        strOfferHtml = strOfferHtml.substring(0, strOfferHtml.length - 13);
    }
    var scrollWidth = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth);
    $.ajax(
        {
            type: "GET",
            async: true,
            dataType: 'xml',
            url: "../ajax/Common/GlobalAjaxResumeInfo.aspx",
            data: "doType=FetchResumeContent&SeqID=" + 0 + "&UserID=" + userID + "&strKey=" + strKey + "&strLang=" + strLang,
            beforeSend: function (XMLHttpRequest) {
                if (hasPic == "1") {
                    $("#img" + rownum).attr("src", ImgLoad);
                    if (strSex == "1") {
                        $("#img" + rownum).bind("error", function () { this.src = ImgWoman; });
                    }
                    else {
                        $("#img" + rownum).bind("error", function () { this.src = ImgMan; });
                    }
                }
                else {
                    if (strSex == "1") {
                        $("#img" + rownum).attr("src", ImgWoman);
                    }
                    else {
                        $("#img" + rownum).attr("src", ImgMan);
                    }
                }

                $("#divResult_" + rownum).html($("#divAjaxLoading01").html());
            },
            success: function (result) {
                var strResume = "", strAddType = "";
                var keyVal = $("#"+ prefixControlID + "hidKeywordCookie").val();
                if (keyVal) keyVal = keyVal.replace(" or "," ").replace(","," ").replace("，"," ");
                if ($(result).find("message").eq(0).text() != "Error") {
                    strAddType = $(result).find("addtype").eq(0).text();
                    var strTr = "<dl class='Common_clearfix'><dt>";
                    var strTd = GR_Colon + "</dt><dd><p>";
                    strResume = "";
                    if (strAddType == "9") {
                        strResume = strResume + "<dl class='Common_clearfix' style='height:110px;valign:top;overflow:hidden;'><dt><dd><p>" + $(result).find("parseresume").eq(0).text() + "</p></dd></dt></dl>";
                    }
                    else if (strAddType == "10") {
                        var strPhone = $(result).find("phone").eq(0).text();
                        if (strPhone == "") strPhone = "&nbsp;";
                        var strKeywords = $(result).find("keywords").eq(0).text();
                        if (strKeywords == "") strKeywords = "&nbsp;";
                        strResume = "";
                        strResume = strResume + strTr + GR_Keywords + strTd + strKeywords + "</p></dd></dt></dl>";
                        strResume = strResume + strTr + GR_ContactNum + strTd + strPhone + "</p></dd></dt></dl>";
                    }
                    else {
                        var strWorkExpLatest = $(result).find("workexplatest").eq(0).text();
                        strWorkExpLatest = EHRResumeList.changeFontColor(keyVal,strWorkExpLatest);
                        if (strWorkExpLatest == "") strWorkExpLatest = "&nbsp;";

                        var strWorkExp = $(result).find("workexp").eq(0).text();
                        strWorkExp = EHRResumeList.changeFontColor(keyVal,strWorkExp);
                        if (strWorkExp == "") strWorkExp = "&nbsp;";

                        var strKeywords = $(result).find("keywords").eq(0).text();
                        strKeywords = EHRResumeList.changeFontColor(keyVal,strKeywords);
                        if (strKeywords == "") strKeywords = "&nbsp;";

                        if (strTopSchool == "") strTopSchool = "&nbsp;";
                        strTopSchool = EHRResumeList.changeFontColor(keyVal,decodeURIComponent(strTopSchool));
                        if(strOfferHtml!=''){
                            strOfferHtml = EHRResumeList.changeFontColor(keyVal,strOfferHtml);
                            strResume = strResume + strTr + GR_ApplyPos + strTd + strOfferHtml + "</p></dd></dt></dl>";
                        }
                        strResume = strResume + strTr + GR_WorkExpLatest + strTd + strWorkExpLatest + "</p></dd></dt></dl>";
                        strResume = strResume + strTr + GR_TopSchool + strTd + strTopSchool + "</p></dd></dt></dl>";
                        strResume = strResume + strTr + GR_WorkExp + strTd + strWorkExp + "</p></dd></dt></dl>";
                        strResume = strResume + strTr + GR_Keywords + strTd + strKeywords + "</p></dd></dt></dl>";
                    }
                }
                $("#divResult_" + rownum).html(strResume);
                $("#divImg_" + rownum).css("display", "");
            },
            complete: function (XMLHttpRequest, textStatus) {
                if (hasPic == "1") {
                    $("#img" + rownum).attr("src", "../Candidate/ReadAttach.aspx?UserID=" + userID)
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                $("#divResult_" + rownum).html("");
            }
        });
}
//下拉浏览器的时候加载数据
EHRResumeList.ScrollLoadOff = function () {
    var getArrays = this.arrays;
    var pageheight = getPageSize().WinH + getPageScroll().Y;
    for (var i = 0; i < getArrays.length; i++) {
        var divHeight = getOffsetTop(getArrays[i].node);
        if (!divHeight) {
            return;
        }
        else {
            if (pageheight > divHeight) {
                if ($("#divResult_" + getArrays[i].rownum).html() != "") {
                    continue;
                }
                this.GetDataByAjaxOffer(getArrays[i]);
            }
        }
    }
}

//应聘管理 end
//组织参数
EHRResumeList.V_GetResumeContent = function (userID, strKey, hasPic, strSex, downEnabled, strTopSchool, strLang, rownum) {
    if ($("#divResult_" + userID).html() != "") {
        return;
    }

    var indexNode = $("#trDetail_" + rownum).prev(); //的到最终要获取的节点.
    var node = indexNode[0]; //转为dom对象
    this.arrays.push({ userID: userID, strKey: strKey, hasPic: hasPic, strSex: strSex, strTopSchool: strTopSchool, strLang: strLang, node: node });
}

//点击展开的时候加载数据.之前的数据已经加载好了，这里只要加载ajax的数据再添加到已经加载的数据中.为了调用方便获取所有参数的数据
EHRResumeList.OnclickLoad = function (objIndex) {
    var row = this.arrays[objIndex];
    this.GetDataByAjax(row.userID, row.strKey, row.strLang, row.hasPic, row.strSex, row.strTopSchool);
}

//下拉浏览器的时候加载数据
EHRResumeList.ScrollLoad = function () {
    var getArrays = this.arrays;
    var pageheight = getPageSize().WinH + getPageScroll().Y;
    for (var i = 0; i < getArrays.length; i++) {
        var divHeight = getOffsetTop(getArrays[i].node);
        if (!divHeight) {
            return;
        }
        else {
            if (pageheight > divHeight) {
                if ($("#divResult_" + getArrays[i].userID).html() != "") {
                    continue;
                }
                this.GetDataByAjax(getArrays[i].userID, getArrays[i].strKey, getArrays[i].strLang, getArrays[i].hasPic, getArrays[i].strSex, getArrays[i].strTopSchool);
            }
        }
    }
}

//ajax获取数据
EHRResumeList.GetDataByAjax = function (userID, strKey, strLang, hasPic, strSex, strTopSchool) {
    if ($("#divResult_" + userID).html() != "") {
        return;
    }
    var scrollWidth = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth);
    $.ajax(
        {
            type: "GET",
            async: true,
            dataType: 'xml',
            url: "../ajax/Common/GlobalAjaxResumeInfo.aspx",
            data: "doType=FetchResumeContent&SeqID=" + 0 + "&UserID=" + userID + "&strKey=" + strKey + "&strLang=" + strLang,
            beforeSend: function (XMLHttpRequest) {
                if (hasPic == "1") {
                    $("#img" + userID).attr("src", ImgLoad);
                    if (strSex == "1") {
                        $("#img" + userID).bind("error", function () { this.src = ImgWoman; });
                    }
                    else {
                        $("#img" + userID).bind("error", function () { this.src = ImgMan; });
                    }
                }
                else {
                    if (strSex == "1") {
                        $("#img" + userID).attr("src", ImgWoman);
                    }
                    else {
                        $("#img" + userID).attr("src", ImgMan);
                    }
                }

                $("#divResult_" + userID).html($("#divAjaxLoading01").html());
            },
            success: function (result) {
                var strResume = "", strAddType = "";
                var keyVal = $("#hidKeywordCookie").val();
                if (keyVal) keyVal = keyVal.replace(" or "," ").replace(","," ").replace("，"," ");
                if ($(result).find("message").eq(0).text() != "Error") {
                    strAddType = $(result).find("addtype").eq(0).text();
                    var strTr = "<dl class='Common_clearfix'><dt>";
                    var strTd = GR_Colon + "</dt><dd><p>";
                    strResume = "";
                    if (strAddType == "9") {
                        strResume = strResume + "<dl class='Common_clearfix' style='height:110px;valign:top;overflow:hidden;'><dt><dd><p>" + $(result).find("parseresume").eq(0).text() + "</p></dd></dt></dl>";
                    }
                    else if (strAddType == "10") {
                        var strPhone = $(result).find("phone").eq(0).text();
                        if (strPhone == "") strPhone = "&nbsp;";
                        var strKeywords = $(result).find("keywords").eq(0).text();
                        if (strKeywords == "") strKeywords = "&nbsp;";
                        strResume = "";
                        strResume = strResume + strTr + GR_Keywords + strTd + strKeywords + "</p></dd></dt></dl>";
                        strResume = strResume + strTr + GR_ContactNum + strTd + strPhone + "</p></dd></dt></dl>";
                    }
                    else {
                        var strWorkExpLatest = $(result).find("workexplatest").eq(0).text();
                        strWorkExpLatest = EHRResumeList.changeFontColor(keyVal,strWorkExpLatest);
                        if (strWorkExpLatest == "") strWorkExpLatest = "&nbsp;";
                        var strWorkExp = $(result).find("workexp").eq(0).text();
                        strWorkExp = EHRResumeList.changeFontColor(keyVal,strWorkExp);
                        if (strWorkExp == "") strWorkExp = "&nbsp;";
                        var strKeywords = $(result).find("keywords").eq(0).text();
                        strKeywords = EHRResumeList.changeFontColor(keyVal,strKeywords);
                        if (strKeywords == "") strKeywords = "&nbsp;";
                        strResume = strResume + strTr + GR_WorkExpLatest + strTd + strWorkExpLatest + "</p></dd></dt></dl>";
                        if (strTopSchool == "") strTopSchool = "&nbsp;";
                        strTopSchool = EHRResumeList.changeFontColor(keyVal,decodeURIComponent(strTopSchool));
                        strResume = strResume + strTr + GR_TopSchool + strTd + strTopSchool + "</p></dd></dt></dl>";
                        strResume = strResume + strTr + GR_WorkExp + strTd + strWorkExp + "</p></dd></dt></dl>";
                        strResume = strResume + strTr + GR_Keywords + strTd + strKeywords + "</p></dd></dt></dl>";
                    }
                }
                $("#divResult_" + userID).html(strResume);
                $("#divImg_" + userID).css("display", "");
            },
            complete: function (XMLHttpRequest, textStatus) {
                if (hasPic == "1") {
                    $("#img" + userID).attr("src", "../Candidate/ReadAttach.aspx?UserID=" + userID)
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                $("#divResult_" + userID).html("");
            }
        });
}
EHRResumeList.changeFontColor = function (arrkey,txt) {
//    var sHtml="<a style='color:red'>"
//    var eHtml="</a>"
//    var keylen="";
//    this.newStr="";
//    var key = "";
//    this.setColor = function (key,txt) {
//        if (txt) {
//            var start_index = txt.indexOf(key)
//            var s;var z;var e;
//            if (start_index>-1) {
//                s=txt.substring(0,start_index);z=key;e=txt.substring(start_index+keylen);
//                this.newStr += s + sHtml + z +eHtml;
//                this.setColor(key,e);
//            }else {
//                this.newStr+=txt;
//            }
//        }
//    }
//    arrkey = arrkey.split(' ');
//    for (var i = 0; i < arrkey.length; i++) {
//        if(arrkey[i]){
//            newStr="";
//            key=arrkey[i];
//            keylen=key.length;
//            this.setColor(key,txt);
//        }
//    }
    
    var sHtml = "<a style='color:red'>";
    var eHtml = "</a>";
	var newStr = txt;
    this.setColor = function (key, fileTXT) {
        var TXT = fileTXT;
        try {
            var resultTXT = "";
            if (TXT) { 
                var arrTXT = (TXT.replace(/<(\s|\S)+?>/igm,function($1) {return '|$|' + $1 + '|$|';})).split("|$|");
                for (var i = 0; i < arrTXT.length; i++) {
                    if(i==0||i%2==0){
                       var reg=new RegExp("("+key+")","ig");  
                        var splitStr = arrTXT[i].replace(reg ,function ($1){return sHtml+$1+eHtml } );
                        resultTXT += splitStr;
                    }
                    else {
                        resultTXT += arrTXT[i];
                    }
            }
			return resultTXT;
        }
        } catch (e) {
            return TXT;
        }
        
        return "";
    }
	if (arrkey) {
        arrkey = arrkey.split(' ');
        arrkey.unique(); //去重
        for (var i = 0; i < arrkey.length; i++) {
            if(arrkey[i]){
                newStr = this.setColor(arrkey[i],newStr);
            }
        }
    }
    return newStr;
}
//
/*------AJAX读取简历XML文件end-------*/

// 打开公共提示层
// objType:按钮类型(HRTMP/HRTMPS:放入暂存夹(不下载);TOCOHR/TOCOHRS:放入公司人才夹(下载))
EHRResumeList.OpenResumeCommonLayer = function (objType, userid, spTitle, spContent, obj , pageCode) {
    // 按钮类型
    if (gid("hidBtnType")) gid("hidBtnType").value = objType.toUpperCase();

    var objHid = gid("hidUserID");
    var singleAndNotinHr = false;
    if (objHid) {
        objHid.value = "";
    }
    else {
        return false;
    }
    if (userid) {
        objHid.value = userid;
        var SeqID = $("input[type='checkbox'][value='" + userid + "']").attr("value1");
        if (SeqID != "" && SeqID != undefined) {
         $("#hidSeqID").val(SeqID);
        }     
    }
    else {
        objHid.value = this.GetSelectedUserID('chkBox',true);
        $("#hidSeqID").val(this.GetSelectedSeqID('chkBox',true));
    }
    if (objType.toUpperCase() != "HRTMPLABEL"&&objHid.value.length == 0) {
        EHR.ShowBox(Msg_SelectResume, 300);
        return false;
    }
    var content = "";
    var w = 400;
    if (objType.toUpperCase() == "HRTMP" || objType.toUpperCase() == "HRTMPS")  // 放入暂存夹
    {
        if(!EHRResumeList.CheckNormalUserID()){
           return false;
        }
        if (objType.toUpperCase() == "HRTMP")  // 单条操作时验证userid是否存在
        { if (objHid.value == null || objHid.value == "" || objHid.value == undefined) return false; }
        content = Msg_ConfirmTemp;
    }
    else if (objType.toUpperCase() == "TOCOHR" || objType.toUpperCase() == "TOCOHRS")  // 放入公司人才夹
    {
        if(!EHRResumeList.CheckNormalUserID()){
          return false;
        }
        if (objType.toUpperCase() == "TOCOHR")  // 单条操作时验证userid是否存在
        { if (objHid.value == null || objHid.value == "" || objHid.value == undefined) return false; }
        content = Msg_ConfirmCandidate;

        var strAuthority=$('#hidStrAuthority').val();
        if (strAuthority==""||strAuthority=="0") {
            var hiduserid=objHid.value.split(',');
            if (hiduserid && hiduserid.length == 1 && hiduserid[0] != '') {
                var downImgId = 'downPic_' + hiduserid[0];
                singleAndNotinHr = true;
                if ($('#' + downImgId).css('display') != 'none') {
                    EHR.ShowBox(Msg_DownloadHr1 + "<br/>", w, 1, "EHRResumeList.ComfirmResumeCommonLayer(\""+$('#hideMarkid').val()+"\","+pageCode+")");
                }
                else {
                    var postData = {
                        userid: gid("hidUserID").value,
                        isSingleUser: '1',
                        "pageCode":pageCode
                    };
                    postData.doType = "SearchToCompanyHr";
                    if (gid('hidWhere') != null) {
                        postData.strWhere = gid('hidWhere').value
                    }
                    EHR.Common_AsyncHandle("POST", "xml", "Resume/GlobalDownload.aspx", postData, this.SearchResumeCompleteHandle);
                }   
            }
        }
        else if(strAuthority=="1"){
            singleAndNotinHr = true;
            EHR.ShowBox(Msg_DownloadUserNoAuthority, 350, 0, "",true);
        }
        else if(strAuthority=="2"){
            singleAndNotinHr = true;
            EHR.ShowBox(Msg_DownloadUserNoDownNum, 350, 0, "",true);
        }

          
    }
    else if (objType.toUpperCase() == "TOCOHRCUSTOM")  // 放入公司人才夹(定制情况)
    {
        singleAndNotinHr = true;
        EHR.ShowBox(spContent + "<br/>", 550, 1, "EHRResumeList.ComfirmResumeCommonLayer(\""+$('#hideMarkid').val()+"\","+pageCode+")");
    }
    else if (objType.toUpperCase() == "TRANSRESUME") {
        CompanyHrTmp.TransResume.show();
        return;
    }
    else if (objType.toUpperCase() == "HRTMPLABEL")  // 添/删标签
    {
        CompanyHrTmp.Label.show(obj);
        return;
    }
    else if (objType.toUpperCase() == "DELHRTMP") {//删除简历
        w = 300;
        EHR.ShowBox(ConfirmDelete + "<br/>", w, 1, "$(\"#btnDel\").click();");
        return;
    } else if(objType.toUpperCase() == "PROCESS") {//应聘进程
        InnerRecommand.Process.show(obj);
        return;
    }
    if (!singleAndNotinHr) {
        EHR.ShowBox(content + "<br/>", w, 1, "EHRResumeList.ComfirmResumeCommonLayer(null,"+pageCode+")");
    }

    return false;
}

// 公共层确认处理(适用于列表页面)
EHRResumeList.ComfirmResumeCommonLayer = function (markid,pageCode) {
    var vbtnType = gid("hidBtnType").value.toUpperCase();  // 点击的按钮类型
    var postData = {
        userid: gid("hidUserID").value
    };
    if (vbtnType == "HRTMP" || vbtnType == "HRTMPS")         // 放入暂存夹(单条/多条)
    {
        postData.doType = "SearchToCompanyTmpHr";
        EHR.Common_AsyncHandle("POST", "xml", "Resume/GlobalDownload.aspx", postData, this.SearchResumeCompleteHandle);
    }
    else if (vbtnType == "TOCOHR" || vbtnType == "TOCOHRS" || vbtnType == "TOCOHRCUSTOM")  // 放入公司人才夹(单条/多条)
    {
        postData.doType = "SearchToCompanyHr";
        if (gid('hidWhere') != null) {
            postData.strWhere = gid('hidWhere').value
        }
        if(pageCode){
            postData.pageCode=pageCode;
        }
        if (vbtnType == "TOCOHRCUSTOM")  // 放入公司人才夹(定制情况)
        {
            if (gid('chkRememberMe') != null) {
                if (gid('chkRememberMe').checked) {
                    postData.rememberMe = 1;
                }
                if (gid('rdbCustomTime').checked) {
                    postData.c = 0;
                    postData.custom = 1;
                } else if (gid('rdbCustomArea').checked) {
                    postData.c = 0;
                    postData.custom = 2;
                }
            }
        }
        if (arguments[0]) {
            postData.markid = arguments[0];
        }
        //this.Comm_CommonAsyncHandle("Resume/GlobalSearchResume.aspx", postData, this.SearchResumeCompleteHandle);
        EHR.Common_AsyncHandle("POST", "xml", "Resume/GlobalDownload.aspx", postData, this.SearchResumeCompleteHandle);
    }

    return false;
}

// 异步完成后处理
EHRResumeList.SearchResumeCompleteHandle = function (result) {
    var isDx = gid("hidUserID").value.split(",").length == 1; //add by zhouye 为了区分是每行按钮还是下方按钮
    var vbtnType = gid("hidBtnType").value.toUpperCase();       // 点击的按钮类型
    var msgtype = $(result).find("msgtype").eq(0).text();         // 处理结果类型
    var returninfo = $(result).find("returninfo").eq(0).text() + "<br/>";   // 结果信息
    var returntitle = $(result).find("tipstitle").eq(0).text();   // 标题信息
    var pagecode = $(result).find("pagecode").eq(0).text(); 
   // var pagecode = 4; 
    if (vbtnType == "HRTMP" || vbtnType == "HRTMPS")         // 放入暂存夹(单条/多条)
    {
        var strResumeIds = $(result).find("strResumeIds").eq(0).text();
        var strErroIds = $(result).find("strErroIds").eq(0).text();
        if (msgtype == "1") {
            EHR.ShowBox(returninfo, 250, 0, "EHRResumeList.CloseSearchResumeMsg()");
        }
        else {
            EHR.ShowBox(returninfo, 250, 0, "EHRResumeList.CloseSearchResumeMsg()");
        }
//        if (strResumeIds != "") {
//            if (strErroIds != "") {
//                strResumeIds=","+strResumeIds+",";
//                var erroids = strErroIds.split(',');
//                for (var i = 0; i < erroids.length; i++) {
//                    strResumeIds = strResumeIds.replace(","+$.trim(erroids[i])+",", ',');
//                }
//                var resumeIds = strResumeIds.split(',');
//                var strRedumes = "";
//                for (var i = 0; i < resumeIds.length; i++) {
//                    if ($.trim(resumeIds[i]) != "") {
//                        strRedumes += resumeIds[i] + '|';
//                    }
//                }
//                if (strRedumes != "")
//                    //EHR.Common_AsyncAddLog('0', '26', "1" + strRedumes.substring(0, strRedumes.length - 1), '');
//                    EHR.Common_AsyncAddLog('3', '1104', "20#"+strRedumes.substring(0, strRedumes.length - 1), '');
//            }
//            else {
//                //EHR.Common_AsyncAddLog('0', '26', "1" + strResumeIds, '');
//                EHR.Common_AsyncAddLog('3', '1104', "20#"+strResumeIds.replace(/,/g,'|'), '');
//            }
//        }


    }
    else if (vbtnType == "TOCOHR" || vbtnType == "TOCOHRS")  // 放入公司人才夹(单条/多条)
    {
        var returnIds = $(result).find("successids").eq(0).text();   // 成功id
        var extendIds = $(result).find("existids").eq(0).text();   // 已存在id
        var returncertIds = $(result).find("certids").eq(0).text();   // 成功id
        var isSingle = $(result).find("isSingle").eq(0).text();
        var markId = $(result).find("markId").eq(0).text();
        if (msgtype == "11")   // 定制情况
        {
            EHRResumeList.OpenResumeCommonLayer("TOCOHRCUSTOM", gid("hidUserID").value, returntitle, returninfo,this,pagecode);
        }
        else {
            EHRResumeList.ChangeDownloadNum(returnIds);
            if(isSingle == "0" || isSingle == "1") {
                if(markId) $('#hideMarkid').val(markId);
                EHR.ShowBox(returninfo, 400, 1, "EHRResumeList.ComfirmResumeCommonLayer(\""+$('#hideMarkid').val()+"\","+pagecode+")");
            }
            else {
                $('#hideMarkid').val("");
                EHR.ShowBox(returninfo, 350, 0, "EHRResumeList.CloseSearchResumeMsg(\"" + returnIds + "\",\"" + extendIds + "\",\"" + returncertIds + "\")",true);
            }
        }
//        if (returnIds != "")
//            EHR.Common_AsyncAddLog('0', '25', "1" + returnIds, '');
    }
    else if (vbtnType == "TOCOHRCUSTOM")     // 放入公司人才夹(定制情况)
    {
        var returnIds = $(result).find("successids").eq(0).text();   // 成功id
        var extendIds = $(result).find("existids").eq(0).text();   // 已存在id
        var returncertIds = $(result).find("certids").eq(0).text();   // 成功id
        EHR.ShowBox(returninfo, 300, 0, "EHRResumeList.CloseSearchResumeMsg(\"" + returnIds + "\",\"" + extendIds + "\",\"" + returncertIds + "\")");
        EHRResumeList.ChangeDownloadNum(returnIds);
//        if (returnIds != "")
//            EHR.Common_AsyncAddLog('0', '25', "1" + returnIds, '');
    }
}

// 放入暂存夹、放入人才夹异步处理完成后处理(仅适用列表页面)
// 关闭提示层
EHRResumeList.CloseSearchResumeMsg = function (ids, extendIds, cids) {
    // 关闭提示层
    //if (OpenMask != null) CloseDivMask();
    // 关闭提示层后处理
    var vbtnType = gid("hidBtnType").value.toUpperCase();   // 点击的按钮类型
    if (vbtnType == "HRTMP" || vbtnType == "HRTMPS")         // 放入暂存夹(单条/多条)
    {
        // 页面不刷新，取消选择框的勾选
        this.DoSelectAll('chkBox', null);
        gid('radSelactALLt').checked = null;
        gid('radSelactALLd').checked = null;
    }
    else if (vbtnType == "TOCOHR" || vbtnType == "TOCOHRS" || vbtnType == "TOCOHRCUSTOM")       // 放入公司人才夹(单条/多条)、定制情况
    {
        // 页面不刷新，取消选择框的勾选
        this.DoSelectAll('chkBox', null);
        gid('radSelactALLt').checked = null;
        gid('radSelactALLd').checked = null;
        //对成功的id加入图标
        var uids = ids.split(',');
        for (var i = 0; i < uids.length; i++) {
            if (gid('downPic_' + uids[i])) gid('downPic_' + uids[i]).className = 'Common_picidsp';
        }
        var eids = extendIds.split(',');
        for (var i = 0; i < eids.length; i++) {
            if (gid('downPic_' + eids[i])) gid('downPic_' + eids[i]).className = 'Common_picidsp';
        }
        var cuids = cids.split(',');
        for (var i = 0; i < cuids.length; i++) {
            var cuserids = cuids[i].split('|');
            if (cuserids.length > 1) {
                if (gid('certPic_non_' + cuserids[0])) {
                    gid('certPic_non_' + cuserids[0]).className = 'Common_picidsp';
                    //gid('certPic_non_' + cuserids[0]).onclick = "EHRResumeList.OpenCert('" + cuserids[1] + "','" + cuserids[0] + "')";
                    $('#certPic_non_' + cuserids[0]).live('click', function(){
                        EHRResumeList.OpenCert(cuserids[1],cuserids[0]);
                    });
                }
                if (gid('certPic_' + cuserids[0])) gid('certPic_' + cuserids[0]).className = 'Common_picdisp_none';
            }
        }
    }
}

//不刷新页面改变显示下载数
EHRResumeList.ChangeDownloadNum = function (ids) {
    var spanDownloadNum = $("#spanDownloadNum");
    var hidDownloadNum = $("#hidDownloadNum");
    if(hidDownloadNum){
        var uids = ids.split(',');
        var downum=0;
        var downloadNum = parseInt(hidDownloadNum.val());
        for (var i = 0; i < uids.length; i++) {
            if (gid('downPic_' + uids[i])) downum++;
        }
        if(downum!=0){
            downloadNum = downloadNum - downum;
            hidDownloadNum.val(downloadNum);
            if(spanDownloadNum) spanDownloadNum.html("【" + downloadNum + "】");
        }
        if(downloadNum==0) $("#hidStrAuthority").val('2');
    }
}

// 打开诚信认证窗口
EHRResumeList.OpenCert = function (key, resumeid) {
    if (certUrl != "") {
        var url = certUrl + "key=" + key + "&resumeid=" + resumeid;
        window.open(url, "_blank", "scrollbars=yes,Width=800px,Height=650px,resizable=yes");
    }
}

//搜索结果页设置蒙层高度
EHRResumeList.SetMaskHeight = function () {
    //居住地、户口
    var area = $("#globalDiv");
    if (area.css('display') != 'none') area.css('height', $(document).height());
    var kind = $("#DivBoxMask");
    if (kind.css('display') != 'none') kind.css('height', $(document).height());
}
//获取用户习惯的选择字段
EHRResumeList.getUserColl = function () {
    var userColl = "";
    $("#cbxColumns").find("input").each(function () {
        if ($(this).attr('CHECKED') == 'checked')
            userColl += $(this).val() + ',';
    })
    if (userColl.length > 1)
        userColl = userColl.substring(0, userColl.length - 1);
    EHRResumeList.userColl = userColl;
}
//根据用户习惯初始化选择字段
EHRResumeList.setUserColl = function () {
    if (EHRResumeList.userColl) {
        var UColls = EHRResumeList.userColl.split(',');
        var collLength = $("#cbxColumns").find("input").length;
        for(var i=0;i<collLength;i++)
        {
            $('input[id=cbxColumns_'+i+']').attr('checked',false);
            for (var j = 0; j < UColls.length; j++) {
                if($('input[id=cbxColumns_'+i+']').val()==UColls[j])
                    $('input[id=cbxColumns_'+i+']').attr('checked',true);
            }
        }
    }
}

//判断是否为未定义
function isUndefined(exp) {
    if (typeof (exp) == "undefined" || exp ==null) {
        return true;
    }
    return false;
}

//获取event
function getEvent() {
    if (window.event) { return window.event; }
    func = getEvent.caller;
    while (func != null) {
        var arg0 = func.arguments[0];
        if (arg0) {
            if ((arg0.constructor == Event || arg0.constructor == MouseEvent
                || arg0.constructor == KeyboardEvent)
                || (typeof (arg0) == "object" && arg0.preventDefault
                && arg0.stopPropagation)) {
                return arg0;
            }
        }
        func = func.caller;
    }
    return null;
}


/****************添加快速反馈 start**************/
EHRResumeList.feedbackclick = function (code,pagecode, rownum) {
    var postData = "";
    if (!rownum) {
        if ($("[name=btnfeedback]").eq(code - 1).attr("class").indexOf("ev-btn-click")>-1) {
            return;
        } else {
             var isinfeedback="0";
            if($("div[name=infeedstatus]").length>0){
                isinfeedback="1";
            }
        
            postData = { "doType": "SetFeedbackExtend", "feedbacktype": code, "CVLOGID": $("#hidSeqID").val(), "JOBID": $("#hidJobID").val(), "USERID": $("#hidUserID").val(),"pagecode":pagecode ,"isinfeedback":isinfeedback,"hidIsFilter":$("#hidIsFilter").val()};
        }
    }
    else {
        if ($("#divOperationBtn" + rownum + " [name=btnfeedback]").eq(code - 1).attr("class").indexOf("ev-btn-click")>-1) {
            return;
        } else {
            var obj = $("[rowid=" + rownum + "]");
            var isinfeedback="0";
            if($("#trBaseInfo_" + rownum + " td:first").attr("class").indexOf("ev-icon-mark")>-1){
                isinfeedback="1";
            }
            postData = { "doType": "SetFeedbackExtend", "feedbacktype": code, "CVLOGID": obj.attr("value1"), "JOBID": obj.attr("value2"), "USERID": obj.attr("value"),"pagecode":pagecode,"isinfeedback":isinfeedback,"hidIsFilter":$("#hidIsFilter").val()};
        }

    }
    $.ajax({
        type: "POST",
        async: false,
        dataType: 'xml',
        url: "../Ajax/chat/GlobalChatApplyFeedBackAjax.ashx",
        data: postData,
        success: function (result) {
            var msgtype = $(result).find("msgtype").eq(0).text();
            var message = $(result).find("message").eq(0).text();
            if (msgtype == "0") {
                var returninfo = $(result).find("returninfo").eq(0).text();
                if (returninfo != "") {
                    EHR.ShowBox(returninfo, 300);
                }
                return;
            }
            else if (msgtype == "1") {
                var obj;
                var classname="";
                if (!rownum) {
                    obj = $("[name=btnfeedback]");
                      obj.attr("class", "ev-btn-gray");
                } else {
                    obj = $("#divOperationBtn" + rownum + " [name=btnfeedback]");
                      classname=" ev-btn-mt";
                      obj.attr("class", "ev-btn-blue"+classname);
                }
              
                obj.each(function (i) {
                     obj.eq(i).find("i").remove();
                });
                
                var btnobj = obj.eq((code - 1));
                var btntext = btnobj.html();
                btnobj.attr("class", "ev-btn-click"+classname).html(btntext + "<i class=\"icon ev-icon-24h-right\"></i>");
                if (rownum) {
                    var trBaseInfo = $("#trBaseInfo_" + rownum + " td:first");
                    if (trBaseInfo.attr("class").indexOf("ev-icon-mark") > -1) {
                        trBaseInfo.attr("class", "ev-icon-mark01");
                        var widthhtml="";
                        if(btntext.length>=5){
                             widthhtml="style=\"width:70px;\"";
                        }
                        trBaseInfo.find("[class=ev-mark-tips]").html("<div class=\"ev-mark-tips01\""+widthhtml+">" + btntext + "</div>");
                    }
                }
            }
        }
    });
}


EHRResumeList.chatentryclick = function (urlparam) {
        PostSubmit("../WyChat/index.aspx",urlparam);
}
function PostSubmit(url, para1) {  
    var postUrl = url;//提交地址           
    var paralist=para1.split("&");
    var ExportForm = document.createElement("FORM");  
    document.body.appendChild(ExportForm);  
    ExportForm.method = "POST";  
    for (var i = 0; i < paralist.length; i++) {
    var param=paralist[i].split("=");
     var newElement = document.createElement("input");  
    newElement.setAttribute("name", param[0]);  
    newElement.setAttribute("type", "hidden");    
   
    ExportForm.appendChild(newElement);  
     newElement.value =  param[1]; 
}

    ExportForm.action = postUrl;  
    ExportForm.target = "_blank";  
    ExportForm.submit();  
    document.body.removeChild(ExportForm);  
  
}  
/****************添加快速反馈 END**************/